const koa = require('koa')
const mongoose = require('mongoose')
const bodyParser = require('koa-bodyparser')
const router = require('./router')


mongoose.connect(`mongodb://localhost:27017/local`,{ useNewUrlParser: true, useUnifiedTopology: true  })
const app = new koa()
app.use(bodyParser())
app
.use(router.routes())
.use(router.allowedMethods())

app.listen('3000',() => console.log(`running on port 3000...`))